package com.lyz.dataStructure.algorithm.道通科技2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 22:27
 * @Description:
 **/

import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(shu(n));
    }
    public static int shu(int n ){
        if(n>16777216){
            return 0;
        }
        int sum =0;

        for(int i =1;i<=n;i++){

            if(n%i==0){
                int m =n/i;
                if(m%2!=0){
                    sum = sum +m;
                }
            }
        }
       return sum;
    }
}
